Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update functions to use odc-geo and add additional content to tests #1039

Merged
merged 13 commits into from
Apr 21, 2023

Conversation

robbibt
Copy link
Member

@robbibt robbibt commented Apr 17, 2023

Proposed changes

odc-geo is a fantastic package of tools for performing spatial operations on datacube-loaded data, and will soon replace datacube's existing Geobox functionality: opendatacube/datacube-core#1424

This PR addresses #1038 by switching some of our DEA Tools functions (mainly in dea_tools.plotting across to using odc-geo for spatial operations. This will make it much easier for us to transition to odc-geo functionality once it replaces datacube's current Geobox functionality, and will simplify some other code updates in the pipeline (e.g. changes to our coastal scripts). The key change is that rather than doing this to access a datacube Geobox:

ds.geobox

We now do:

ds.odc.geobox

As part of this PR, I've also made a few minor additional changes:

  • added the How_to_guides/Animated_timeseries.ipynb notebook to our automated tests
  • deprecated the map_shapfile func as Geopandas supports interactive plotting natively via .explore
  • removed the "ga_s2_1" and "ga_ls_2" collection options in calculate_band_indices, as we no longer have those collections in DEA

Have run every notebook on these changes and confirmed they all pass. 🙂

Closes issues (optional)

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@robbibt robbibt marked this pull request as ready for review April 20, 2023 00:02
@robbibt robbibt merged commit 398d7f4 into develop Apr 21, 2023
@robbibt robbibt deleted the plotting_fixes branch April 21, 2023 05:39
erin-telfer added a commit that referenced this pull request May 1, 2023
* Readme update (#1019)

* test this

* permalink to the template notebook

* trying to get the link working

* Update README.rst

* Update README.rst

---------

Co-authored-by: Nathan <95725385+treefern@users.noreply.github.com>

* upgrade docker-compose postgres image version to 13

* Update bandindices.py (#1022)

Added Normalised Difference Turbidity Index to the 'calculate_indices' tool.
NB. acronym 'NDTI' is already in use for Tillage Index. Acronym 'TI' used in lieu.

* Readme Update (#1025)

Updating to include link back to wiki for approving/reviewing pull requests.

* Tiny doc update to remote build trigger (#1026)

* Update trigger_docs.yaml

Add explanation of triggering build in other doc repo

* Formatting suggestions from review

* Fix `pixel_tides` issues when `ds` has no time dimension (#1028)

* Update pixel_tides func to cover edge cases

* Sync with develop branch

* Hard code dimension order instead of getting dims from ds

* Clean code

* Update USAGE.rst (#1029)

I've added a recently accepted manuscript where I used DEA to calulcate Geomedians and show landscape changes. And the relevant years where we've used DEA sandbox in our remote sensing topics at Flidners university.
Additionally added a conference presentation from AEO22 from Earth Observation Australia 2022 in Brisbane,

* Update spellcheck_wordlist.txt

* Update DEA Notebooks directory structure (#1027)

* New interactive apps folder, moved appropriate notebooks inside

* Deleted scientific_workflows

* rename DEA_datasets folder to DEA_products

* updated 17 notebook references from DEA_datasets to DEA_products

* Rename frequently used code

* Fix incorrect repo folders

* Revert to before dir rename

* Rename frequently used code

* Update readme for DEA_products and How_to_guides

* replace notebook references to Frequently_used_code with How_to_guides

* replace notebook references to frequently used code with How_to_guides

* replaced notebook references to DEA_datasets

* Add readme to interactive apps

* updated Real_world_examples readme

* Remove defunct tests (replaced by nbval --lax)

* Update readme to include interactive apps

* Use stable branch

* Update real world examples format

* Update guided tutorial link

* Update template to remove mention of scientific workflows and Scripts dir

* Fix formatting

* Fix formatting

* Last attempt to fix template notebook formatting

* Final final fix of formatting

---------

Co-authored-by: erialC-P <claire.phillips@ga.gov.au>

* Fix geocoding func to still work if geocoding service is down (#1030)

* Fix geocoding func to still work if geocoding service is down

* Fix format

* Extract coastline app from product notebook and move to Interctive_apps (#1032)

* Update spellcheck_wordlist.txt (#1037)

add:
Ai
Fanson
Fickas
Ronan

* Update USAGE.rst (#1036)

Added Wetlands paper!!

* Replace conference paper with Wetlands paper (#1034)

updated citation list with paper

* Update plotting.py

Added a tool named 'plot_variable_images' primarily for use in the "Burnt_area_mapping_near_real_time" notebook.

* Update plotting.py

* Update plotting.py

* small correction to new tool in plotting.py

Added extra check to handle error when the input xarray dataset has 0 images.

* Update plotting.py

Actioned suggestion to raise error.

* Add Sentinel-2 and Landsat option to animation notebook (#1043)

* Add Sentinel-2 and Landsat option to animation notebook

* Set default resolutions

* Fix bug where choosing combined product didn't trigger data reload

* Update functions to use `odc-geo` and add additional content to tests (#1039)

* Make geobox adding func more generic

* Remove deprecated map_shapefiles func and replace with .explore

* Use odc-geo geobox in xr_animation

* Add geomedian collection option to calculate_indices

* Update animation notebook to use geomedian so we can add it to tests

* Update tests to run on animation notebook

* Fix collection number in segmentation notebook

* Update rgb func to use odc-geo

* Fix attributes being dropped by xr.where, update deprecation version

* Remove assign_crs from rgb (not needed), and add error handling to xr_animation

* Use better error

* Re-run affected notebooks

* Update collection param in ML notebooks

* Add manual reload trigger to layer selection (#1044)

---------

Co-authored-by: Bex Dunn <BexDunn@users.noreply.github.com>
Co-authored-by: Nathan <95725385+treefern@users.noreply.github.com>
Co-authored-by: Pin Jin <pindge.j@gmail.com>
Co-authored-by: Pin Jin <pin.jin@ga.gov.au>
Co-authored-by: Matt-dea <129345253+Matt-dea@users.noreply.github.com>
Co-authored-by: LaurenSchenk1 <125851593+LaurenSchenk1@users.noreply.github.com>
Co-authored-by: Robbi Bishop-Taylor <Robbi.BishopTaylor@ga.gov.au>
Co-authored-by: mdasi00 <91014391+mdasi00@users.noreply.github.com>
Co-authored-by: erialC-P <claire.phillips@ga.gov.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant